/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/<a href="https://www.kaaction.com">KAA</a>"><a href="https://www.kaaction.com">KAA</a></a> All rights reserved.
 */
package com.kaaction.modules.ka.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kaaction.common.persistence.Page;
import com.kaaction.common.service.CrudService;
import com.kaaction.modules.ka.entity.MaterialDetails;
import com.kaaction.modules.ka.dao.MaterialDetailsDao;

/**
 * 物料明细管理Service
 * @author huanghaiming
 * @version 2017-04-26
 */
@Service
@Transactional(readOnly = true)
public class MaterialDetailsService extends CrudService<MaterialDetailsDao, MaterialDetails> {

	public MaterialDetails get(String id) {
		return super.get(id);
	}
	
	public List<MaterialDetails> findList(MaterialDetails materialDetails) {
		return super.findList(materialDetails);
	}
	
	public Page<MaterialDetails> findPage(Page<MaterialDetails> page, MaterialDetails materialDetails) {
		return super.findPage(page, materialDetails);
	}
	
	@Transactional(readOnly = false)
	public void save(MaterialDetails materialDetails) {
		super.save(materialDetails);
	}
	
	@Transactional(readOnly = false)
	public void delete(MaterialDetails materialDetails) {
		super.delete(materialDetails);
	}

	@Transactional(readOnly = false)
	public void deleteAll(MaterialDetails materialDetails) {
		String[] ids = materialDetails.getIds();
		for(String id : ids){
			materialDetails.setId(id);
			super.delete(materialDetails);
		}
		
	}

	public int getEqual(MaterialDetails materialDetails) {
		return super.dao.getEqual(materialDetails);
	}
	
}